<?php
function mPrint($val)
{
  echo "\r\n<pre>\r\n";
  print_r($val);
  echo "\r\n</pre>\r\n";
  // echo json_encode($val, JSON_UNESCAPED_UNICODE);
}
function mj($val){
  echo json_encode($val, JSON_UNESCAPED_UNICODE);
}

function curl_post($url, $data = array())
{
  // die(json_encode($data));
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
  // POST数据
  curl_setopt($ch, CURLOPT_POST, 1);
  // 把post的变量加上
  curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
  $output = curl_exec($ch);
  curl_close($ch);
  return $output;
}
$data = json_decode(file_get_contents('php://input'), true);
mPrint($data);
